package com.itheima.test3;

public class GodTest {
    public static void main(String[] args) {
        Good[] goods = new Good[3];

        Good good1 = new Good(1, "西瓜", 20, 30);
        Good good2 = new Good(2, "苹果", 30, 20);
        Good good3 = new Good(3, "香蕉", 40, 10);

        goods[0] = good1;
        goods[1] = good2;
        goods[2] = good3;

        for (int i = 0; i < goods.length; i++) {
            System.out.print(goods[i].getId() + " ");
            System.out.print(goods[i].getGoodName() + " ");
            System.out.print(goods[i].getPrice() + " ");
            System.out.print(goods[i].getCount());
            System.out.println("");
        }
    }
}
